Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unaligned memory access when reading DRM events #191

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

tronical
Copy link
Contributor

Running with debug assertions enabled on armv7 (an stm32mp157) panics due to unaligned memory reads:

thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x8 but is 0xbec90b44', .../drm-0.9.0/src/control/mod.rs:906:34

Fix this by using the corresponding functions from core to safely copy the data (in C we'd do a memcpy).

@Drakulix
Copy link
Member

Could you rebase this one as well please? :)

Running with debug assertions enabled on armv7 (an stm32mp157) panics
due to unaligned memory reads:

thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x8 but is 0xbec90b44', .../drm-0.9.0/src/control/mod.rs:906:34

Fix this by using the corresponding functions from core to safely
copy the data (in C we'd do a memcpy).
@tronical
Copy link
Contributor Author

Done. Sorry, took a while :). The #[allow(unknown_lints)] #[allow(invalid_reference_casting)] is still there, as I'm not sure if they can be removed. How can I test?

@Drakulix
Copy link
Member

Done. Sorry, took a while :). The #[allow(unknown_lints)] #[allow(invalid_reference_casting)] is still there, as I'm not sure if they can be removed. How can I test?

Just remove them and see if CI fails. If it does we need to add them again. (I think the error comes from different type-aliases on different platforms, so this is difficult to test outside of CI.)

@Drakulix Drakulix merged commit 32aec87 into Smithay:develop Mar 27, 2024
16 checks passed
@Drakulix
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants